

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>ceph-dencoder -- ceph 编码器/解码器工具 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="ceph-mon -- ceph 监视器守护进程" href="../ceph-mon/" />
    <link rel="prev" title="ceph-debugpack -- ceph 调试信息打包工具" href="../ceph-debugpack/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../../rados/">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../../../rados/man/">对象存储手册页</a></li>
      <li class="breadcrumb-item active">ceph-dencoder -- ceph 编码器/解码器工具</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/man/8/ceph-dencoder.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../rados/configuration/">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/operations/">运维</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../rados/man/">    手册页</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../ceph-volume/">ceph-volume -- Ceph OSD 部署和检查工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-volume-systemd/">ceph-volume-systemd -- systemd ceph-volume 辅助工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph/">ceph -- Ceph 管理工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-authtool/">ceph-authtool -- ceph 密钥环操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-clsinfo/">ceph-clsinfo -- 查看类对象信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">ceph-conf -- ceph 配置文件工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-debugpack/">ceph-debugpack -- ceph 调试信息打包工具</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">ceph-dencoder -- ceph 编码器/解码器工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">提纲</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">描述</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">实例</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">使用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-mon/">ceph-mon -- ceph 监视器守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-osd/">ceph-osd -- ceph 对象存储守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-kvstore-tool/">ceph-kvstore-tool -- ceph 的 kvstore 操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-run/">ceph-run -- 发生核心转储后重启守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-syn/">ceph-syn -- ceph 的人造负载生成器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushdiff/">crushdiff -- ceph crush 图测试工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushtool/">crushtool -- CRUSH 图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../librados-config/">librados-config -- 显示关于 librados 的信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monmaptool/">monmaptool -- ceph 监视器运行图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osdmaptool/">osdmaptool -- ceph osd 运行图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rados/">rados -- rados 对象存储工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-post-file/">ceph-post-file -- 把文件上传给 ceph 开发者</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="ceph-dencoder-ceph">
<h1>ceph-dencoder -- ceph 编码器/解码器工具<a class="headerlink" href="#ceph-dencoder-ceph" title="Permalink to this heading"></a></h1>
<section id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>ceph-dencoder</strong> [commands…]</div>
</div>
</section>
<section id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p><strong>ceph-dencoder</strong> 工具用来编码、解码和转储 Ceph 数据结构。
常用于调试或测试版本间的兼容性。</p>
<p><strong>ceph-dencoder</strong> 只是简单地读入命令列表并依次执行。</p>
</section>
<section id="id3">
<h2>命令<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-version">
<span class="sig-name descname"><span class="pre">version</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-version" title="Permalink to this definition"></a></dt>
<dd><p>打印 <strong>ceph-dencoder</strong> 二进制程序的版本字符串。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-import">
<span class="sig-name descname"><span class="pre">import</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;file&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-import" title="Permalink to this definition"></a></dt>
<dd><p>从指定文件读入已编码的二进制数据块。
它将被放入内存驻留缓冲。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-export">
<span class="sig-name descname"><span class="pre">export</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;file&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-export" title="Permalink to this definition"></a></dt>
<dd><p>把当前内存驻留缓冲的内容写入指定文件。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-list_types">
<span id="cmdoption-ceph-dencoder-arg-list-types"></span><span class="sig-name descname"><span class="pre">list_types</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-list_types" title="Permalink to this definition"></a></dt>
<dd><p>列出此 <strong>ceph-dencoder</strong> 程序已知的所有数据类型。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-type">
<span class="sig-name descname"><span class="pre">type</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;name&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-type" title="Permalink to this definition"></a></dt>
<dd><p>为即将进行的 <code class="docutils literal notranslate"><span class="pre">encode</span></code> 或 <code class="docutils literal notranslate"><span class="pre">decode</span></code> 操作指定类型。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-skip">
<span class="sig-name descname"><span class="pre">skip</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;bytes&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-skip" title="Permalink to this definition"></a></dt>
<dd><p>导入的文件先找到 &lt;bytes&gt; 字节处再开始读数据结构，
当对象中感兴趣的部分之前有前同步码或头部时可加此选项。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-decode">
<span class="sig-name descname"><span class="pre">decode</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-decode" title="Permalink to this definition"></a></dt>
<dd><p>把内存驻留缓冲中的内容解码为之前选定类型的例程。
若遇到错误，则只报告。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-encode">
<span class="sig-name descname"><span class="pre">encode</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-encode" title="Permalink to this definition"></a></dt>
<dd><p>把之前选定类型的驻留内存例程编码为驻留内存缓冲。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-dump_json">
<span id="cmdoption-ceph-dencoder-arg-dump-json"></span><span class="sig-name descname"><span class="pre">dump_json</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-dump_json" title="Permalink to this definition"></a></dt>
<dd><p>打印内存驻留对象 JSON 格式的描述。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-count_tests">
<span id="cmdoption-ceph-dencoder-arg-count-tests"></span><span class="sig-name descname"><span class="pre">count_tests</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-count_tests" title="Permalink to this definition"></a></dt>
<dd><p>打印出之前选定类型、且 <strong>ceph-dencoder</strong> 支持的内建测试例程数量。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-select_test">
<span id="cmdoption-ceph-dencoder-arg-select-test"></span><span class="sig-name descname"><span class="pre">select_test</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;n&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-select_test" title="Permalink to this definition"></a></dt>
<dd><p>用指定的内建测试例程作为同类型的内存驻留例程。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-get_features">
<span id="cmdoption-ceph-dencoder-arg-get-features"></span><span class="sig-name descname"><span class="pre">get_features</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-get_features" title="Permalink to this definition"></a></dt>
<dd><p>打印此版本 <strong>ceph-dencoder</strong> 所支持功能集的十进制值。
每一位表示一个功能，它们对应于
src/include/ceph_features.h 中定义的 CEPH_FEATURE_* 。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-ceph-dencoder-arg-set_features">
<span id="cmdoption-ceph-dencoder-arg-set-features"></span><span class="sig-name descname"><span class="pre">set_features</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;f&gt;</span></span><a class="headerlink" href="#cmdoption-ceph-dencoder-arg-set_features" title="Permalink to this definition"></a></dt>
<dd><p>把提供给 <code class="docutils literal notranslate"><span class="pre">encode</span></code> 的功能位设置为 <em>f</em> 。
设置了此选项你就能编码出旧版软件可理解的对象（它所支持的类型）。</p>
</dd></dl>

</section>
<section id="id4">
<h2>实例<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h2>
<p>比如你想检查 <code class="docutils literal notranslate"><span class="pre">ceph-osd</span></code> 存储的一对象的一个属性，可以这样：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cd /mnt/osd.12/current/2.b_head
$ attr -l foo_bar_head_EFE6384B
Attribute &quot;ceph.snapset&quot; has a 31 byte value for foo_bar_head_EFE6384B
Attribute &quot;ceph._&quot; has a 195 byte value for foo_bar_head_EFE6384B
$ attr foo_bar_head_EFE6384B -g ceph._ -q &gt; /tmp/a
$ ceph-dencoder type object_info_t import /tmp/a decode dump_json
{ &quot;oid&quot;: { &quot;oid&quot;: &quot;foo&quot;,
      &quot;key&quot;: &quot;bar&quot;,
      &quot;snapid&quot;: -2,
      &quot;hash&quot;: 4024842315,
      &quot;max&quot;: 0},
  &quot;locator&quot;: { &quot;pool&quot;: 2,
      &quot;preferred&quot;: -1,
      &quot;key&quot;: &quot;bar&quot;},
  &quot;category&quot;: &quot;&quot;,
  &quot;version&quot;: &quot;9&#39;1&quot;,
  &quot;prior_version&quot;: &quot;0&#39;0&quot;,
  &quot;last_reqid&quot;: &quot;client.4116.0:1&quot;,
  &quot;size&quot;: 1681,
  &quot;mtime&quot;: &quot;2012-02-21 08:58:23.666639&quot;,
  &quot;lost&quot;: 0,
  &quot;wrlock_by&quot;: &quot;unknown.0.0:0&quot;,
  &quot;snaps&quot;: [],
  &quot;truncate_seq&quot;: 0,
  &quot;truncate_size&quot;: 0,
  &quot;watchers&quot;: {}}
</pre></div>
</div>
<p>或者，你也许想转储一个内部 CephFS 元数据对象，
可以这样：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ rados -p metadata get mds_snaptable mds_snaptable.bin
$ ceph-dencoder type SnapServer skip 8 import mds_snaptable.bin decode dump_json
{ &quot;snapserver&quot;: { &quot;last_snap&quot;: 1,
   &quot;pending_noop&quot;: [],
   &quot;snaps&quot;: [],
   &quot;need_to_purge&quot;: {},
   &quot;pending_create&quot;: [],
   &quot;pending_destroy&quot;: []}}
</pre></div>
</div>
</section>
<section id="id5">
<h2>使用范围<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h2>
<p><strong>ceph-dencoder</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、
分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</section>
<section id="id6">
<h2>参考<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<p><a class="reference internal" href="../ceph/"><span class="doc">ceph</span></a>(8)</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../ceph-debugpack/" class="btn btn-neutral float-left" title="ceph-debugpack -- ceph 调试信息打包工具" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../ceph-mon/" class="btn btn-neutral float-right" title="ceph-mon -- ceph 监视器守护进程" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>